<html>
<head>
	<meta charset='utf-8' />
	<title>小区信息助手后台</title>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
	<style>
		@media screen and (max-width:450px){
			#content{width:98%;margin:0 auto}
			/*页面宽度900以下时 .abc的宽度为450*/
		}
		@media screen and (min-width:450px){
			#content{width:450px;margin:0 auto}
			/*页面宽度900以下时 .abc的宽度为450*/
		}
	</style>
</head>
<body>
<div id='content' style='position:relative'>
	<h1 style='text-align:center'>后台管理登陆</h1>
	<div style=''>
		<div style='width:250px;margin:20px auto'>
			用户名：<input type="text" id='user' />
		</div>

		<div style='width:250px;margin:20px auto'>
			密　码：<input type="password" id='pwd' />
		</div>


		<div style='width:250px;margin:20px auto;text-align:center'>
			<button id='login'>登陆</button>
		</div>
	</div>
</div>
</body>
</html>
<script src='../public/jquery.js'></script>
<script src='../public/fun.js'></script>
<script>
$(function(){
	$('#login').click(function(){
		var user = $('#user').val().trim();
		var pwd = $('#pwd').val().trim();
		if(!user || !pwd){
			return;
		}
		var data = {
			user:user,
			pwd:pwd,
			type:'login'
		};
		Ajax(data,function(res){
			C(res);
			var t = JSON.parse(res);
			switch(t.stat){
				case 'ok':
					sessionStorage.admin_user = user;
					sessionStorage.admin_token1 = t.token1;
					sessionStorage.admin_bottom_nav = 'index'; //重置导航下标
					A('登陆成功！');
					location.replace('after_con_index.html');
				break;
				case 'err1':A('用户已封禁!');break;
				case 'err2':case 'err3':A('用户名或密码不正确');break;
			}
		},after_interface);		
	});
});

</script>